<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>模拟title</title>
  <style>
    div {
      position: relative;
      width: 120px;
      line-height: 38px;
      height: 38px;
      margin: 100px auto;
      color: #333;
      text-align: center;
      font-size: 24px;
      cursor: pointer;
    }

    div:hover::before {
      content: attr(data-msg);
      position: absolute;
      top: -50px;
      left: 10px;
      padding: 2px 6px;
      color: #333;
      border: 1px solid #333;
      border-radius: 5px;
      font-size: 14px;
    }

    div:hover::after {
      content: "";
      border-top: 5px solid #333;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      position: absolute;
      top: -6px;
      left: 60px;
    }
  </style>
</head>

<body>
  <div data-msg="类title框展示"> hover me</div>
</body>

</html>